const ENV = {
    "env_prod": {
        "REDIS_HOST": "localhost",
        "REDIS_PORT": "6379",
        "REDIS_PASS": "1234",
        "REDIS_DB": "1",
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASS": "1234"
    },
    "env_test": {
        "REDIS_HOST": "localhost",
        "REDIS_PORT": "6379",
        "REDIS_PASS": "1234",
        "REDIS_DB": "1",
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASS": "1234"
    },
    "env_dev": {
        "REDIS_HOST": "localhost",
        "REDIS_PORT": "6379",
        "REDIS_PASS": "1234",
        "REDIS_DB": "1",
        "MYSQL_HOST": "localhost",
        "MYSQL_PORT": "3306",
        "MYSQL_USER": "root",
        "MYSQL_PASS": "1234"
    }
};

module.exports = {
    "apps": [
        {
            "name": "${rootArtifactId}",
            "script": "/usr/bin/java",
            "args": [
                "-Djava.security.egd=file:/dev/./urandom",
                "-jar",
                "${rootArtifactId}-api/target/${rootArtifactId}-api.jar"
            ],
            "exec_interpreter": "",
            "exec_mode": "fork",
            ...ENV
        },
    ],
    deploy: {
        prod: {
            host: ['192.168.99.110'],
            user: '<deploy_user>',
            ssh_options: "StrictHostKeyChecking=no",
            ref: '<your_branch>', // (use 'origin/master' for your master branch,
            repo: "git@gitee.com:<your_git_user>/<your_repo>.git", // your repo url
            path: "~/deploy/${rootArtifactId}",
            "post-deploy": "sh deploy.sh prod",
        },
        test: {
            host: ['192.168.99.110'],
            user: '<deploy_user>',
            ssh_options: "StrictHostKeyChecking=no",
            ref: '<your_branch>', // (use 'origin/master' for your master branch,
            repo: "git@gitee.com:<your_git_user>/<your_repo>.git", // your repo url
            path: "~/deploy/${rootArtifactId}",
            "post-deploy": "sh deploy.sh test",
        },
        dev: {
            host: ['192.168.99.110'],
            user: '<deploy_user>',
            ssh_options: "StrictHostKeyChecking=no",
            ref: '<your_branch>', // (use 'origin/master' for your master branch,
            repo: "git@gitee.com:<your_git_user>/<your_repo>.git", // your repo url
            path: "~/deploy/${rootArtifactId}",
            "post-deploy": "sh deploy.sh dev",
        }
    }
};
